package com.cjk.controller;

import com.cjk.pojo.Result;
import com.cjk.pojo.JobOption;
import com.cjk.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * 查询员工职位分布数据
     * @return
     */
    @GetMapping("/empJobData")
    public Result JobOption(){
        log.info("查询员工职位分布数据");
        JobOption jobOption = reportService.JobOption();
        return Result.success(jobOption);
    }

    /**
     * 查询员工性别分布数据
     * @return
     */
    @GetMapping("/empGenderData")
    public Result GenderOption(){
        log.info("查询员工性别分布数据");
        List<Map<String, Object>>  genderList= reportService.GenderOption();
        return Result.success(genderList);
    }
}
